USE [VIETPUBLISHER]
GO

/****** Object:  Table [dbo].[T_BK_PriceHistory]    Script Date: 06/04/2012 17:42:07 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[T_BK_PriceHistory](
	[BookID] [int] NULL,
	[NumberID] [int] NOT NULL,
	[Price] [float] NOT NULL,
	[PriceDate] [datetime] NOT NULL,
	[PromotionPrice] [float] NULL,
 CONSTRAINT [PK_PriceHistory] PRIMARY KEY CLUSTERED 
(
	[NumberID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Gia khuyen mai' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_BK_PriceHistory', @level2type=N'COLUMN',@level2name=N'PromotionPrice'
GO

ALTER TABLE [dbo].[T_BK_PriceHistory]  WITH CHECK ADD  CONSTRAINT [FK_T_BK_PriceHistory_T_BK_Book] FOREIGN KEY([BookID])
REFERENCES [dbo].[T_BK_Book] ([BookID])
GO

ALTER TABLE [dbo].[T_BK_PriceHistory] CHECK CONSTRAINT [FK_T_BK_PriceHistory_T_BK_Book]
GO

ALTER TABLE [dbo].[T_BK_PriceHistory] ADD  CONSTRAINT [DF_PriceHistory_Price]  DEFAULT ((0)) FOR [Price]
GO

ALTER TABLE [dbo].[T_BK_PriceHistory] ADD  CONSTRAINT [DF_PriceHistory_PromotionPrice]  DEFAULT ((0)) FOR [PromotionPrice]
GO


